﻿using System;
using System.Configuration;

namespace Microsoft.CISG.BitlockerRecovery.BL
{

    public class Configuration
    {

        public static string UnauthorizedPage
        {
            get
            {
                if (!(ConfigurationSettings.AppSettings["SmartCardAuthentication_UnauthorizedPage"] == null))
                {
                    return  ConfigurationSettings.AppSettings["SmartCardAuthentication_UnauthorizedPage"];
                }
                else
                {
                    return string.Empty;
                }
            }
        }
        public static string IncorrectCertificate
        {
            get
            {
                if (!(ConfigurationSettings.AppSettings["SmartCardAuthentication_IncorrectCertificate"] == null))
                {
                    return ConfigurationSettings.AppSettings["SmartCardAuthentication_IncorrectCertificate"];
                }
                else
                {
                    return string.Empty;
                }
            }
        }

        public static string ConnectionString
        {
            get
            {
                if (!(ConfigurationSettings.AppSettings["SmartCardAuthentication_ConnectionString"] == null))
                {
                    return ConfigurationSettings.AppSettings["SmartCardAuthentication_ConnectionString"];
                }
                else
                {
                    return string.Empty;
                }
            }
        }

        public static int ConnectionTimeout
        {
            get
            {
                if (!(ConfigurationSettings.AppSettings["SmartCardAuthentication_ConnectionTimeout"] == null))
                {
                    return int.Parse(ConfigurationSettings.AppSettings["SmartCardAuthentication_ConnectionTimeout"]);
                }
                else
                {
                    return 180;
                }
            }
        }
    }
}
